#ifndef __ROM_POINTERS_H
#define __ROM_POINTERS_H

# include "object.h"
# include "base.h"

/* Object / Data pointers */
# define BASE_PTR                   ((struct RomBase **)0x009A116C)
# define PARTY_PTR                  ((void *)0x009BE95C)
# define PARTY_MAX_PTR              ((void *)0x009BE960)
# define ENVIRONMENT_PTR            ((struct RomObject ***)0x009F4FDC)
# define ENVIRONMENT_SIZE_PTR       ((unsigned int*)0x009F4FE0)
# define ENVIRONMENT_MAX_PTR        ((unsigned int*)0x009F4FE4)

/* Function pointers */
# define ROMOBJECT_SETTARGET        ((void *)0x00845160)    /* thiscall, arg1 = object ptr   */
# define ROMBASE_CLICKOBJECT        ((void *)0x005E75A0)    /* thiscall, needs investigation */

/* Misc pointers */
# define STEALTHHACK_PTR            ((void *)0x0084D35C)

/* Some assembly excerpts I wish to save to update pointers in the future
 * Most of these are also posted on http://rombot.pastebin.com
 */

/*******************
 * ENVIRONMENT_PTR *
 ***********************************************************************
 * 008B3F90 | 33C9                   | XOR     ECX, ECX                |
 * 008B3F92 | B8 01000000            | MOV     EAX, 1                  |
 * 008B3F97 | BA 04000000            | MOV     EDX, 4                  |
 * 008B3F9C | F7E2                   | MUL     EDX                     |
 * 008B3F9E | 0F90C1                 | SETO    CL                      |
 * 008B3FA1 | F7D9                   | NEG     ECX                     |
 * 008B3FA3 | 0BC8                   | OR      ECX, EAX                |
 * 008B3FA5 | 51                     | PUSH    ECX                     |
 * 008B3FA6 | E8 5564B6FF            | CALL    0041A400                |
 * 008B3FAB | A3 F44F9F00            | MOV     DWORD PTR [9F4FF4], EAX |  <<--
 * 008B3FB0 | 33C0                   | XOR     EAX, EAX                |
 * 008B3FB2 | 68 F0618B00            | PUSH    8B61F0                  |
 * 008B3FB7 | A3 F84F9F00            | MOV     DWORD PTR [9F4FF8], EAX |  <<--
 * 008B3FBC | C705 FC4F9F00 01000000 | MOV     DWORD PTR [9F4FFC], 1   |
 * 008B3FC6 | A3 00509F00            | MOV     DWORD PTR [9F5000], EAX |
 * 008B3FCB | E8 1B64FEFF            | CALL    0089A3EB                |
 * 008B3FD0 | 83C4 08                | ADD     ESP, 8                  |
 * 008B3FD3 | C3                     | RETN                            |
 ***********************************************************************/

/*************
 * PARTY_PTR *
 **************************************************************
 * 0064BDA7 | 57            | PUSH    EDI                     |
 * 0064BDA8 | 76 02         | JBE     0064BDAC                |
 * 0064BDAA | FFD3          | CALL    NEAR EBX                |
 * 0064BDAC | 8BFE          | MOV     EDI, ESI                |
 * 0064BDAE | 8BFF          | MOV     EDI, EDI                |
 * 0064BDB0 | 8B35 60E99B00 | MOV     ESI, DWORD PTR [9BE960] | <<--
 * 0064BDB6 | 3935 5CE99B00 | CMP     DWORD PTR [9BE95C], ESI | <<--
 * 0064BDBC | 76 02         | JBE     0064BDC0                |
 * 0064BDBE | FFD3          | CALL    NEAR EBX                |
 * 0064BDC0 | 3BFE          | CMP     EDI, ESI                |
 * 0064BDC2 | 74 5E         | JE      0064BE22                |
 **************************************************************/

#endif //__ROM_POINTERS_H

